/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cl.tienda.control;

import cl.tienda.modelo.Producto;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

/**
 *
 * @author Onfire
 */
public class AgregarController1 extends MultiActionController {
  
    private Producto product;

    public void setProductos(Producto product) {
        this.product = product;
    }
    
    public ModelAndView agregarProductos1(HttpServletRequest request, HttpServletResponse response) throws Exception {

        ModelAndView mav = new ModelAndView("AgregarProducto1");
        
        mav.addObject("imagen", "img/carritorx8[1].jpg");
        mav.addObject("titulo", "Carrito de Compas con JSP y Sesiones");
        mav.addObject("agregar", product.getProductos());
        mav.addObject("direccion","agregarProductos2.htm?cod=");

        return mav;
    } 
    
        public ModelAndView agregarStock1(HttpServletRequest request, HttpServletResponse response) throws Exception {

        ModelAndView mav = new ModelAndView("AgregarStock1");
        
        mav.addObject("imagen", "img/carritorx8[1].jpg");
        mav.addObject("titulo", "Carrito de Compas con JSP y Sesiones");
        mav.addObject("agregar", product.getProductos());
        mav.addObject("direccion","agregarProductos2.htm?cod=");

        return mav;
    } 
}
